<template>
  <div class="detail-content">
<!--    <div class="title"></div>-->
    <pulldown header="社会支持网络分析">
      <div slot="content">

        <table class="table" width="100%" cellspacing="0" cellpadding="0" border="1">
          <tbody>
          <tr>
            <td class="label">社会生态系统及说明</td>
            <td>{{estimateMainQuestion.societyEcologicalExplain}}</td>
          </tr>
          </tbody>
        </table>
      </div>
    </pulldown>


<!--    <div class="title"></div>-->
    <pulldown header="案主表征及主诉问题/需求">
      <div slot="content">
        <table class="table" width="100%" cellspacing="0" cellpadding="0" border="1">
          <tbody>
          <tr>
            <td class="label"> (一) 案主目前对吸食毒品的态度/看法</td>
            <td>{{estimateMainQuestion.attitude}}</td>
          </tr>
          <tr>
            <td class="label">（二）案主曾做过的努力和成功经验</td>
            <td>{{estimateMainQuestion.successExperience}}</td>
          </tr>
          <tr>
            <td class="label">（三）是否呈现需要及时处理的问题</td>
            <td>{{getEstimateKeywordListStr(1)}}</td>
          </tr>
          <tr>
            <td class="label">（四）案主主诉问题或需求</td>
            <td>{{estimateMainQuestion.question}}</td>
          </tr>
          </tbody>
        </table>
      </div>
    </pulldown>


<!--    <div class="title"></div>-->
    <pulldown header="评估服务需要">
      <div slot="content">
        <table class="table" width="100%" cellspacing="0" cellpadding="0" border="1">
          <tbody>
          <tr>
            <td style="min-width: 20%;" class="label">生理脱毒（毒品相关）情况</td>
            <td style="min-width: 20%;">{{getEstimateKeywordListStr(2)}}</td>
            <!-- <td></td> -->
          </tr>
          <tr>
            <td style="min-width: 20%;" class="label">身心康复情况</td>
            <td style="min-width: 20%;">{{getEstimateKeywordListStr(3)}}</td>
          </tr>
          <tr>
            <td style="min-width: 20%;" class="label">行为表现情况</td>
            <td style="min-width: 20%;">{{getEstimateKeywordListStr(4)}}</td>
          </tr>
          <tr>
            <td class="label">社会环境与适应能力</td>
            <td colSpan="2">{{getEstimateKeywordListStr(5)}}</td>

          </tr>
          <tr>
            <td class="label">危机性问题处理能力</td>
            <td colSpan="2">{{getEstimateKeywordListStr(6)}}</td>
          </tr>
          <tr>
            <td class="label">其他需要说明的事项</td>
            <td colSpan="5">{{estimateMainQuestion.otherExplain}}</td>
          </tr>
          </tbody>
        </table>
      </div>
    </pulldown>


<!--    <div class="title"></div>-->
    <pulldown header="社工意见">
      <div slot="content">
        <table class="table" width="100%" cellspacing="0" cellpadding="0" border="1">
          <tbody>
          <tr>
            <td class="label">是否跟进</td>
            <td>{{estimateMainQuestion.isFollow === 1 ? '是' : `否，${reasonFollow}`}}</td>
            <td class="label">是否紧急</td>
            <td>{{estimateMainQuestion.isUrgency === 1 ? '是' : `否，${reasonUrgency}`}}</td>
          </tr>
          </tbody>
        </table>
      </div>
    </pulldown>


<!--    <div class="title"></div>-->
    <pulldown header="督导意见">
      <div slot="content">
        <table class="table" width="100%" cellspacing="0" cellpadding="0" border="1">
          <tbody>
          <tr>
            <td class="label">建议跟进重点及注意事项</td>
            <td>{{estimateMainQuestion.supervisorOpinion}}</td>
          </tr>
          </tbody>
        </table>
      </div>
    </pulldown>


  </div>
</template>

<script>
import {
  estimateDetails
} from '@/api/sjsk/estimate/list/index.js'
import pulldown from '../../../modules/pulldown'
export default {
  data() {
    return {
      estimateCare: {},
      estimateKeywordList: {},
      estimateMainQuestion: {},

    }
  },
  components:{pulldown},
  created() {
    const {
      sjskPersonId
    } = this.$route.query
    this.getDetail(sjskPersonId)
  },
  methods: {
    getDetail(id) {
      estimateDetails('3').then(res => {
        const {
          success,
          result
        } = res
        if (success) {
          this.estimateCare = result.estimateCare
          this.estimateKeywordList = result.estimateKeywordList
          this.estimateMainQuestion = result.estimateMainQuestion
        }
      })
    },
    getEstimateKeywordListStr(value) {
      let str = ''
      this.estimateKeywordList.map(item => {
        if(item.value == value) {
          const hasRemark = item.keyword.includes('其他') || item.keyword.includes('原因')
          hasRemark ? str += `${item.keyword}:${item.reamrk},` : str += `${item.keyword},`
        }
      })
      str.slice(0, str.length - 1)
      return str
    }
  }
}
</script>

<style lang="less" scoped>
.detail-content {
  background-color: #fff;
  .title {
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;

    font-size: 18px;
    font-weight: bold;
  }
  .sub-title{
    padding-bottom: 20px;
    font-weight: bold;
  }
  .user-desc {
    display: flex;
    margin: 20px 0;

    .head {
      width: 100px;
      height: 100px;
    }

    .desc {}
  }

  .table{
    margin: 20px 0;
    border-color: #E8E8E8 !important;
    .label{
      background-color: #FAFAFA;
      width: 220px;
      text-align: center;
    }
    td{
      padding: 12px;
    }
  }
}
</style>
